class MonogramFamiliesController < ApplicationController
	
  def index
    list
    render :action => 'list'
  end

  # GETs should be safe (see http://www.w3.org/2001/tag/doc/whenToUseGet.html)
  verify :method => :post, :only => [ :destroy, :create, :update ],
         :redirect_to => { :action => :list }

  def list
   @monograms = MonogramFamily.find(:all)   
  end
  
  def new
    @monogram_family = MonogramFamily.new
  end

  def create
    @family = MonogramFamily.new(params[:monogram_family])
    if @family.save
      flash[:notice] = 'Family was successfully created.'
      redirect_to :action => 'list'
    else
      render :action => 'new'
    end
  end
  def show 
  	@monogram_family = MonogramFamily.find(params[:id])
  end
  def edit
    @monogram_family = MonogramFamily.find(params[:id])
  end

  def update
    @monogram_family = MonogramFamily.find(params[:id])
    if @monogram_family.update_attributes(params[:monogram_family])
      flash[:notice] = 'Family was successfully updated.'
      redirect_to :action => 'show', :id => @monogram_family
    else
      render :action => 'edit'
    end
  end

  def destroy
    MonogramFamily.find(params[:id]).destroy
    redirect_to :action => 'list'
  end 
end
